<div id="innovationsPages">
    <div class="post">
        <h2 class="title">Innovations</h2>
        <div class="entry">
            <input type="button" value="Add new" onclick="show('#new_innov')"/>

            <?php
         //   if ($this->session->userdata("admin")) {
            ?>
                <input type="button" value="Search" onclick="show('#searchInnovations')"/>
                <input type="button" value="Clear Search" onclick="clearSearch()"/>
            <?php
          //  }
            ?>
            <div id="innov_result" class="info">
                <?= $message ?>
            </div>




            <script type="text/javascript">
                function searchInnovations(){
                    field=document.getElementById("searchInnovationsForm").field.value;
                    search=document.getElementById("searchInnovationsForm").search.value;
                    $("#innovationsPages").load("<?= base_url(); ?>index.php?/admin_mis/innovations/"+field+"/"+search);
                }
                function clearSearch(){
                    $("#innovationsPages").load("<?= base_url(); ?>index.php?/admin_mis/innovations/");
                }
            </script>

            <!--a href="" id="hide3" >Hide</a> <a href="" id="show3" >Show</a-->
            <div id="new_innov" style="display: none;margin-bottom: 10px;">
                <?php $data['id'] = "app_form" ?>
                <?= form_open_multipart('mis/saveInnovation', $data); ?>
                <table>
                    <tr class="darker"><td class="half">Innovation</td><td><input type="text" class="wide" name="idea" value="<?php echo set_value('idea'); ?>" /></td> </tr>
                    <tr class="lighter"><td>Beneficiaries</td><td><input type="text" class="wide"  name="beneficiaries" value="<?php echo set_value('beneficiaries'); ?>" /></td> </tr>
                    <tr  class="darker"><td>Business case (Max. 1000 words)</td><td><textarea  class="wide" name="business_case" rows="7"><?php echo set_value('business_case'); ?></textarea> </td> </tr>
                    <tr  class="lighter"><td>Return on Investment</td><td><input type="text"  class="wide" name="roi" value="<?php echo set_value('roi'); ?>" /></td> </tr>
                    <tr  class="lighter"><td>Assessment remarks</td><td><input type="text"  class="wide" name="assess_remarks" value="<?php echo set_value('assess_remarks'); ?>" /></td> </tr>
                    <tr  class="darker"><td>Implementation status</td><td><input type="text"  class="wide" name="imple_status" value="<?php echo set_value('imple_status'); ?>" /></td> </tr>
                    <tr  class="darker"><td>File/Minutes/remarks</td><td><input type="file"  class="wide" name="userfile" /></td> </tr>
                    <tr><td colspan="2" style="text-align: right">
                            <input type="submit" value="Submit" />
                            <input type="button" value="Cancel" onclick="hide('#new_innov')"/>
                        </td></tr>
                </table>
                </form>
            </div>


            <div id="searchInnovations" style="display: none;margin-bottom: 10px;">
                <form id="searchInnovationsForm">
                    <table>
                        <tr class="darker"><td class="half">Select search criteria</td>
                            <td><select name="field">
                                    <option value='all'>All</option>
                                    <option value='idea'>Idea</option>
                                    <option value='business_case'>Business case</option>
                                    <option value='beneficiaries'>Beneficiaries</option>
                                    <option value='imple_status'>Implementation status</option>
                                    <option value='assess_remarks'>Assessment remarks</option>
                                    <option value='added_by'> Added by</option>
                                </select></td>
                            <td><input type="text" name="search" class="wide"  value="<?php echo set_value('added_by'); ?>" /></td>
                        </tr>

                        <tr><td colspan="3" style="text-align: right">
                                <input type="button" value="Submit" onclick="searchInnovations()" />
                                <input type="button" value="Cancel" onclick="hide('#searchInnovations')"/>
                            </td></tr>

                    </table>
                </form>
            </div>



            <div id="all_innov">
                <?= $tablet ?>
                <?= $pagina ?>
            </div>

        </div>
    </div>
</div>